import java.util.*;
public class Main{
    public static void main(String[]args){
        Scanner scan=new Scanner(System.in);
        int num=scan.nextInt();
        scan.nextLine();
        String str=scan.nextLine();
        mouseMove(num,str);
    }
    public static void mouseMove(int num,String str){
        int first=1;int mouse=1;
        if(num<=4){
            for(int i=0;i<str.length();i++){
                if(mouse==1&&str.charAt(i)=='U'){
                    mouse=num;
                }else if(mouse==num&&str.charAt(i)=='D'){
                    mouse=1;
                }else if(str.charAt(i)=='U'){
                    mouse--;
                }else{
                    mouse++;
                }

            }
            for(int i=1;i<num;i++){
                System.out.print(i+" ");
            }
            System.out.println(num);
            System.out.println(mouse);
        }else{
            for(int i=0;i<str.length();i++){
                if(first==1&&mouse==1&&str.charAt(i)=='U'){
                    mouse=num;first=num-3;
                }else if(first==num-3&&mouse==num&&str.charAt(i)=='D'){
                    mouse=1;first=1;
                }else if(first!=1&&mouse==first&&str.charAt(i)=='U'){
                    mouse--;first--;
                }else if(first!=num-3&&mouse==first+3&str.charAt(i)=='D'){
                    mouse++;first++;
                }else if(str.charAt(i)=='U'){
                    mouse--;
                }else{
                    mouse++;
                }

            }
            for(int i=first;i<first+3;i++){
                System.out.print(i+" ");
            }
            System.out.println(first+3);
            System.out.println(mouse);
        }
    }
}